cc.Class({
    extends: cc.Component,

    properties: {
        rankno_img: cc.Sprite,
        rankno_lab: cc.Label,
        head: cc.Sprite,
        playerName: cc.Label,
        dan_icon: cc.Sprite,
        dan_dsc: cc.Label,
        start_icon: cc.Sprite,
        start_num: cc.Label,
        Allrank:cc.SpriteAtlas,

    },

    // LIFE-CYCLE CALLBACKS:

    onLoad() {

    },
    init(data) {
        if (data.rankno > 3) {
            this.rankno_img.node.active = false;
            this.rankno_lab.node.active = true;
            this.rankno_lab.string = data.rankno;
        } else if(data.rankno===0) {
            this.rankno_img.node.active=false;
            this.rankno_lab.node.active = true;
            this.rankno_lab.string = "未上榜";
        }else {
            /*gold bronze silver */
            this.rankno_img.node.active=true;
            this.rankno_lab.node.active = false;
            this.rankno_img.getComponent(cc.Sprite).spriteFrame=this.Allrank.getSpriteFrame("icn_tankrank_"+data.rankno)

        }
        this.playerName.string = data.name;

        this.dan_dsc.string = data.dandsc;

        this.start_num.string = data.start_num;
    },

    start() {

    },

    // update (dt) {},
});
